package action;

import impl.TBookDAOimpl;
import model.TBook;
import DAO.TBookDAO;

import com.alibaba.fastjson.JSON;
import com.opensymphony.xwork2.ActionSupport;
/**
 * 添加图书---cg
 * @author Administrator
 *
 */
public class addbookAction extends ActionSupport {
	private TBook TBook;
	
		public TBook getTBook() {
		return TBook;
	}
	
	public void setTBook(TBook tBook) {
		TBook = tBook;
	}

	/**
	 * @return
	 */
	public String execute() {
		TBookDAO tb=new TBookDAOimpl();
		int i= tb.addbook(TBook);
		String json=JSON.toJSONString(TBook);
		return SUCCESS;
	}
}